/*     */ package nc.impl.codefactory.codecreater;
/*     */ 
/*     */ import java.io.ByteArrayOutputStream;
/*     */ import java.io.PrintStream;
/*     */ import java.util.ArrayList;
/*     */ import java.util.Date;
/*     */ import java.util.List;
/*     */ import java.util.logging.Logger;
/*     */ import nc.bs.framework.common.InvocationInfoProxy;
/*     */ import nc.bs.framework.common.NCLocator;
/*     */ import nc.codeplatform.framework.IManifest;
/*     */ import nc.codeplatform.framework.commons.Manifest;
/*     */ import nc.itf.uap.cil.ICilService;
/*     */ import nc.itf.uap.rbac.IUserManageQuery;
/*     */ import nc.vo.ml.NCLangRes4VoTransl;
/*     */ import nc.vo.pub.BusinessException;
/*     */ import nc.vo.sm.UserVO;
/*     */ import nc.vo.sm.enumfactory.UserIdentityTypeEnumFactory;
/*     */ 
/*     */ public class ICAHandler
/*     */ {
/*  22 */   static Logger LOG = Logger.getLogger(ICAHandler.class.getName()); private Integer currectVersion; public ICAHandler(String currectVersion) {
/*  23 */     this.currectVersion = Manifest.VERSION_DEF;
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */     
/*  29 */     this.currectVersion = Integer.valueOf(Integer.parseInt(currectVersion));
/*     */   }
/*     */   private boolean success; private String message;
/*     */   public void handler() {
/*     */     try {
/*  34 */       handler0();
/*  35 */     } catch (Throwable e) {
/*  36 */       this.success = false;
/*  37 */       this
/*  38 */         .message = NCLangRes4VoTransl.getNCLangRes().getStrByID("codecreater", "0codecreater0078");
/*  39 */       ByteArrayOutputStream out = new ByteArrayOutputStream();
/*  40 */       e.printStackTrace(new PrintStream(out));
/*  41 */       LOG.warning(out.toString());
/*     */     } 
/*     */   }
/*     */ /*     */   

/*     */   private void handler0() throws BusinessException {
/*  47 */     Date now = new Date();
/*  48 */     List<String> authVersionList = new ArrayList<String>();
/*  49 */     authVersionList.add("NCC" + Integer.toString(IManifest.VERSION2005.intValue()));
/*  50 */     authVersionList.add("NCC" + Integer.toString(IManifest.VERSION2105.intValue()));
/*  51 */     authVersionList.add("NCC" + Integer.toString(IManifest.VERSION2111.intValue()));
/*  52 */     authVersionList.add("NCC" + Integer.toString(IManifest.VERSION2207.intValue()));
/*  53 */     authVersionList.add(Integer.toString(IManifest.VERSION2005.intValue()));
/*  54 */     authVersionList.add(Integer.toString(IManifest.VERSION2105.intValue()));
/*  55 */     authVersionList.add(Integer.toString(IManifest.VERSION2111.intValue()));
/*  56 */     authVersionList.add(Integer.toString(IManifest.VERSION2207.intValue()));
/*  57 */     if (authVersionList.contains(Integer.toString(this.currectVersion.intValue()))) {
/*  58 */       ICilService sercvice = (ICilService)NCLocator.getInstance().lookup(ICilService.class);
/*  59 */       boolean pvalue = sercvice.containsProduct("1088CODEFAC");
/*  60 */       if (pvalue) {
/*  61 */         if (this.currectVersion.intValue() < IManifest.VERSION2207.intValue()) {
/*  62 */           this.success = true;
/*     */           
/*     */           return;
/*     */         } 
/*  66 */         boolean verifyFlag = verifyDeveloper();
/*  67 */         if (verifyFlag) {
/*  68 */           this.success = true;
/*     */         } else {
/*  70 */           this.success = false;
/*  71 */           this
/*  72 */             .message = NCLangRes4VoTransl.getNCLangRes().getStrByID("codecreater", "0codecreater0141");
/*     */         } 
/*     */       } else {
/*  75 */         this.success = false;
/*  76 */         this
/*  77 */           .message = NCLangRes4VoTransl.getNCLangRes().getStrByID("codecreater", "0codecreater0079");
/*     */       } 
/*     */       
/*     */       return;
/*     */     } 
/*  82 */     this.success = false;
/*  83 */     this
/*  84 */       .message = NCLangRes4VoTransl.getNCLangRes().getStrByID("codecreater", "0codecreater0081");
/*     */   }
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */   
/*     */   private boolean verifyDeveloper() throws BusinessException {
/*  93 */     boolean flag = false;
/*  94 */     String userId = InvocationInfoProxy.getInstance().getUserId();
/*  95 */     if (userId != null) {
/*  96 */       UserVO userVO = ((IUserManageQuery)NCLocator.getInstance().lookup(IUserManageQuery.class)).getUser(userId);
/*  97 */       if (userVO != null && userVO.getBase_doc_type() != null && userVO
/*  98 */         .getBase_doc_type().equals(UserIdentityTypeEnumFactory.TYPE_DEVELOPER) ) {
/*  99 */         flag = true;
/*     */       }
/*     */     } 
/* 102 */     return flag;
/*     */   }
/*     */ 
/*     */   
/* 106 */   public boolean isSuccess() throws BusinessException { return this.success; }
/*     */ 
/*     */ 
/*     */   
/* 110 */   public String getMessage() { return this.message; }
/*     */ }


/* Location:              D:\CodeTool\BIP\homebipv3\modules\lcdp\META-INF\lib\lcdp_codecreaterLevel-1.jar!/nc/impl/codefactory/codecreater/ICAHandler.class
 * Java compiler version: 8 (52.0)
 * JD-Core Version:       1.0.7
 */